<?php
declare (strict_types = 1);

namespace app\exam\service;

use think\facade\Request;
use app\common\service\BaseService;
use app\exam\logic\Order as OrderLogic;

/**
 * 订单服务类
 */
class Order extends BaseService
{

    /**
     * 考试订单渲染页面
     * Author   亓官雨树<lucky.max@foxmail.com>
     * Date     21/03/29
     * @return \think\Response
     */
    public function orderPaperFetch()
    {
        $param = Request::get();
        $data  = app(OrderLogic::class)->orderPaperFetch($param);
        
        return $this->parseToData($data, 1, '获取成功');
    }

    /**
     * 生成考试订单
     * Author   亓官雨树<lucky.max@foxmail.com>
     * Date     21/03/29
     * @return \think\Response
     */
    public function orderPaperCreate()
    {
        $param = Request::post();
        $data  = app(OrderLogic::class)->createPaperOrder($param);
        
        return $this->parseToData($data, 1, '订单提交成功');
    }

    /**
     * 专项订单渲染页面
     * Author 亓官雨树<lucky.max@foxmail.com>
     * Date 2021-04-01
     * @return [type] [description]
     */
    public function orderSpecialFetch()
    {
        $param = Request::get();
        $data  = app(OrderLogic::class)->orderSpecialFetch($param);
        
        return $this->parseToData($data, 1, '获取成功');
    }

    /**
     * 生成专项订单
     * Author 亓官雨树<lucky.max@foxmail.com>
     * Date 2021-04-01
     * @return [type] [description]
     */
    public function orderSpecialCreate()
    {
        $param = Request::post();
        $data  = app(OrderLogic::class)->createSpecialOrder($param);
        
        return $this->parseToData($data, 1, '订单提交成功');
    }
    /**
     * 套卷订单渲染页面
     * Author 亓官雨树<lucky.max@foxmail.com>
     * Date 2021-04-01
     * @return [type] [description]
     */
    public function orderRollupFetch()
    {
        $param = Request::get();
        $data  = app(OrderLogic::class)->orderRollupFetch($param);
        
        return $this->parseToData($data, 1, '获取成功');
    }

    /**
     * 生成套卷订单
     * Author 亓官雨树<lucky.max@foxmail.com>
     * Date 2021-04-01
     * @return [type] [description]
     */
    public function orderRollupCreate()
    {
        $param = Request::post();
        $data  = app(OrderLogic::class)->createRollupOrder($param);
        
        return $this->parseToData($data, 1, '订单提交成功');
    }
}
